# pip3 install PyMySQL
import pymysql

conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='123456', db='wordpress')

cur = conn.cursor()

cur.execute('select * from wp_commentmeta')

for item in cur.fetchall():
    print(type(item))
    print(item)

cur.close()

conn.close()